/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package events.pose;

import gui.SnazzySpritesGUI;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import snazzysprites.SnazzySprites;
import state.Animation;
import state.Pose;
import state.SnazzySpritesState;
import state.SnazzySpritesStateManager;

/**
 * Handles the deletion of the currently selected pose
 * @author Andrew Gratta <andrew.gratta@stonybrook.edu>
 */
public class DeletePoseHandler implements ActionListener{

    @Override
    public void actionPerformed(ActionEvent e) {
        SnazzySprites singleton = SnazzySprites.getSnazzySprites();
        SnazzySpritesStateManager manager = singleton.getStateManager();

        Pose pose = manager.getPose();
        if (pose != null && manager.getAnimation() != null)
        {
            manager.deselectPose();
            manager.getAnimation().deletePose(pose);
        }
    }
    
}
